#pragma once

#include "glm/glm.hpp"
using namespace glm;
#include "Ray.h"
//#include "Shape.h"
class Shape;
class Intersection {
public:
	Intersection();
	Intersection(Ray *_ray);
	~Intersection();

	Ray* ray(){	return theRay; }

	float dist();
	void dist(float _d);

	Shape* shape(){ return theShape; }
	void shape(Shape *_sh){ theShape = _sh; }

	vec3 getPos();			//returns the position of the intersection in world space

	vec3 surfNorm(){ return surfaceNormal; }
	void surfNorm(vec3 _n){	surfaceNormal = _n;	}

	bool intersected(){	return hasIntersect; }

	void intersected(bool _i){ hasIntersect = _i; }

private:
	Ray *theRay;			//a pointer to the ray
	float curDist;			//the distance from the ray origin
	Shape *theShape;		//a pointer to the shape which was intersected
	vec3 surfaceNormal;		//the surface normal of the shape at the intersection point
	bool hasIntersect;

};

